<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('月度评价任务台账列表')"/>
</head>
<body class="pear-container">
<div class="layui-card">
    <div class="layui-card-body">
        <form class="layui-form" action="">
            <div class="layui-form-item">
                <label class="layui-form-label">供电所名称</label>
                <div class="layui-input-inline">
                    <input type="text" name="supplyName" placeholder="" class="layui-input">
                </div>
                <button class="pear-btn pear-btn-md pear-btn-primary" lay-submit
                        lay-filter="auditplan-query">
                    <i class="layui-icon layui-icon-search"></i>
                    查询
                </button>
                <button type="reset" class="pear-btn pear-btn-md">
                    <i class="layui-icon layui-icon-refresh"></i>
                    重置
                </button>
            </div>
        </form>
    </div>
</div>
<div class="layui-card">
    <div class="layui-card-body">
        <table id="auditplan-table" lay-filter="auditplan-table"></table>
    </div>
</div>
</body>

<script id="yingxiao-bar" type="text/html">
    {{#if(d.yingxiaoState != 0 ){ }}
    <img th:src="@{/static/admin/images/img/carryOut.png}" class="layui-nav-img">
    {{# }else{ }}
    <img th:src="@{/static/admin/images/img/notCarryOut.png}" class="layui-nav-img">
    {{# } }}
</script>

<script id="dangjian-bar" type="text/html">
    {{#if(d.dangjianState != 0 ){ }}
    <img th:src="@{/static/admin/images/img/carryOut.png}" class="layui-nav-img">
    {{# }else{ }}
    <img th:src="@{/static/admin/images/img/notCarryOut.png}" class="layui-nav-img">
    {{# } }}
</script>

<script id="jiwei-bar" type="text/html">
    {{#if(d.jiweiState != 0 ){ }}
    <img th:src="@{/static/admin/images/img/carryOut.png}" class="layui-nav-img">
    {{# }else{ }}
    <img th:src="@{/static/admin/images/img/notCarryOut.png}" class="layui-nav-img">
    {{# } }}
</script>

<script id="renzi-bar" type="text/html">
    {{#if(d.renziState != 0 ){ }}
    <img th:src="@{/static/admin/images/img/carryOut.png}" class="layui-nav-img">
    {{# }else{ }}
    <img th:src="@{/static/admin/images/img/notCarryOut.png}" class="layui-nav-img">
    {{# } }}
</script>

<script id="hulianwang-bar" type="text/html">
    {{#if(d.hulianwangState != 0 ){ }}
    <img th:src="@{/static/admin/images/img/carryOut.png}" class="layui-nav-img">
    {{# }else{ }}
    <img th:src="@{/static/admin/images/img/notCarryOut.png}" class="layui-nav-img">
    {{# } }}
</script>

<script id="fazhan-bar" type="text/html">
    {{#if(d.fazhanState != 0 ){ }}
    <img th:src="@{/static/admin/images/img/carryOut.png}" class="layui-nav-img">
    {{# }else{ }}
    <img th:src="@{/static/admin/images/img/notCarryOut.png}" class="layui-nav-img">
    {{# } }}
</script>

<script id="anjian-bar" type="text/html">
    {{#if(d.anjianState != 0 ){ }}
    <img th:src="@{/static/admin/images/img/carryOut.png}" class="layui-nav-img">
    {{# }else{ }}
    <img th:src="@{/static/admin/images/img/notCarryOut.png}" class="layui-nav-img">
    {{# } }}
</script>

<script id="yunjian-bar" type="text/html">
    {{#if(d.yunjianState != 0 ){ }}
    <img th:src="@{/static/admin/images/img/carryOut.png}" class="layui-nav-img">
    {{# }else{ }}
    <img th:src="@{/static/admin/images/img/notCarryOut.png}" class="layui-nav-img">
    {{# } }}
</script>

<script id="houqin-bar" type="text/html">
    {{#if(d.houqinState != 0 ){ }}
    <img th:src="@{/static/admin/images/img/carryOut.png}" class="layui-nav-img">
    {{# }else{ }}
    <img th:src="@{/static/admin/images/img/notCarryOut.png}" class="layui-nav-img">
    {{# } }}
</script>

<script id="gonghui-bar" type="text/html">
    {{#if(d.gonghuiState != 0 ){ }}
    <img th:src="@{/static/admin/images/img/carryOut.png}" class="layui-nav-img">
    {{# }else{ }}
    <img th:src="@{/static/admin/images/img/notCarryOut.png}" class="layui-nav-img">
    {{# } }}
</script>

<script id="xintong-bar" type="text/html">
    {{#if(d.xintongState != 0 ){ }}
    <img th:src="@{/static/admin/images/img/carryOut.png}" class="layui-nav-img">
    {{# }else{ }}
    <img th:src="@{/static/admin/images/img/notCarryOut.png}" class="layui-nav-img">
    {{# } }}
</script>

<script id="bangongshi-bar" type="text/html">
    {{#if(d.bangongshiState != 0 ){ }}
    <img th:src="@{/static/admin/images/img/carryOut.png}" class="layui-nav-img">
    {{# }else{ }}
    <img th:src="@{/static/admin/images/img/notCarryOut.png}" class="layui-nav-img">
    {{# } }}
</script>


<th:block th:include="include :: footer"/>
<script th:inline="javascript" type="text/javascript">
    /*<![CDATA[*/
    var evaluationId = /*[[${evaluationId}]]*/ 20;
    /*]]>*/

    layui.use(['table', 'form', 'jquery'], function () {
        var table = layui.table;
        var form = layui.form;
        var MODULE_PATH = rootPath + "/MonthAuditDtlController/";
        var cols = [
            [

                {title: '任务年月', field: 'taskMonth', align: 'center'},

                {title: '供电所名称', field: 'supplyName', align: 'center'},

                {
                    field: 'taskState', title: '当前状态', align: 'center', templet: function (res) {
                        if (res.taskState == '0') {
                            return '未填报';
                        } else if (res.taskState == '1') {
                            return '待分公司审核';
                        } else if (res.taskState == '2') {
                            return '分公司驳回调整';
                        } else if (res.taskState == '3') {
                            return '待责任部门审核';
                        } else if (res.taskState == '4') {
                            return '责任部门驳回调整';
                        } else if (res.taskState == '5') {
                            return '审核完成';
                        }
                    }
                },

                {title: '营销部', toolbar: '#yingxiao-bar', align: 'center', width: 100},
                {title: '配网部', toolbar: '#yunjian-bar', align: 'center', width: 100},
                {title: '安监部', toolbar: '#anjian-bar', align: 'center', width: 100},
                {title: '党建部', toolbar: '#dangjian-bar', align: 'center', width: 100},
                {title: '纪委办', toolbar: '#jiwei-bar', align: 'center', width: 100},
                {title: '人资部', toolbar: '#renzi-bar', align: 'center', width: 100},
                {title: '互联网办', toolbar: '#hulianwang-bar', align: 'center', width: 100},
                // {title: '发展部', toolbar: '#fazhan-bar', align: 'center', width: 100},
                {title: '综合四室', toolbar: '#houqin-bar', align: 'center', width: 100},
                {title: '工会', toolbar: '#gonghui-bar', align: 'center', width: 100},
                {title: '信通公司', toolbar: '#xintong-bar', align: 'center', width: 100},
                {title: '办公室', toolbar: '#bangongshi-bar', align: 'center', width: 100},

            ]
        ]

        //table表单列表
        table.render({
            elem: '#auditplan-table',
            url: MODULE_PATH + 'list4AuditPlan/' + evaluationId,
            page: false,
            method: 'get',
            cols: cols,
            skin: 'line',
            toolbar: '#auditplan-toolbar',
            defaultToolbar: [{
                layEvent: 'refresh',
                icon: 'layui-icon-refresh',
            }]
        });


        //查询按钮绑定
        form.on('submit(auditplan-query)', function (data) {
            table.reload('auditplan-table', {where: data.field})
            return false;
        });

        //table工具栏绑定
        table.on('toolbar(auditplan-table)', function (obj) {
            if (obj.event === 'add') {
                window.add();
            } else if (obj.event === 'refresh') {
                window.refresh();
            } else if (obj.event === 'batchRemove') {
                window.batchRemove(obj);
            }
        });

        //刷新按钮
        window.refresh = function () {
            table.reload('auditplan-table');
        }
    })
</script>
</html>